C-Sim version 5.0

نویسندگان

  • Roman Jokl
  • Stanislav Racek
چکیده

The paper presents the C-Sim simulation tool that enables an experimental evaluation (i.e. testing) of parallel and distributed programs behavior using their close-toreality C-language source code and a simulated operational environment. 1. Simulation based method of parallel programs testing The method uses discrete-time process-oriented simulation model of a parallel or distributed computer system that executes a program . Source code of the program (that is composed from threads’ or process’ programs ) should be a part of the simulation program source code. Due to the fact that a substantial set of parallel programs is C language written (using e.g. POSIX, PVM or MPI interface), this language seems to be a good implementation basis for the given purpose. Every program can be statically mapped to a Simulalike coroutine and every thread or process of the tested program can be dynamically mapped to a simulation process that is executed using discrete model-time basis. It means that real-time concurrent program execution is transformed into ”interleaved” (i.e. pseudo-parallel) model-time execution. Points of a process execution switching can be recognized as an interaction procedure calls (e.g. I/O call, lock() or unlock() semaphore function calls, etc.). Every locally executed part of a process code (e.g. between lock() and unlock() calls) can be equippedwith a pseudo-statement hold(d) where d is a model-time duration of the execution (either estimated to have a corresponding real-time duration value or generated randomly). The method was described in [5] and its substantial properties are as follows: Simulation based (serialized) execution can be made quite deterministic, even when (pseudo)random numbers generator is used to obtain duration d values. It offers a relatively easy way to remove program bugs. A submodel of a computation environment can be used as a part of simulation program (i.e ), so a close-to-reality data sets or timed sequences can be used as the computation input. Model based repeated execution of a parallel program can evaluate both the control-flow correctness and logical correctness. But it cannot prove the correctness, compared with model-checking method using e.g. the SPIN model checker. Time responses of the computation can be evaluated. This is important e.g. for hard real-time embedded computer control systems and it is not possible to do that using a conventional model-checking method. There is only a minimal semantic gap between the parallel program and its evaluated model because Clanguage written source code serves both for the used algorithm specification (here a kind of executable specification) and implementation purposes. 2. C-Sim version 5.0 implementation principles There are two implementations of pseudo-parallel computation in the C-Sim v. 5.0 library (what is the main improvement when compared with the previous version 4.1 see [6]). The first one is based on the functions setjmp() and longjmp(), which are a part of the standard Clanguage libraries. They provide means for switching the process context without using any nonstandard operations, but their use causes invalidation of stack. This implies some restricting rules for a user of the library, particularly use of local (automatic) variables needs to be explicitly denoted Proceedings of the Third International Conference on Application of Concurrency to System Design (ACSD’03) 0-7695-1887-7/03 $17.00 © 2003 IEEE and switching of process context within a nested function is impossible. On the other side, thousands of processes can be effectively created within a simulation model. The second method of implementation of the pseudoparallel processes is based on the use of POSIX threads. A thread is created for each simulation process. C-Sim run-time control assures that only one thread is being executed at a time. The POSIX implementation is slower than long-jump implementation because the process switching in threads is more complex than the long-jump operation. On the other side this implementation removes the above stated limitations of its counterpart. Library user may choose desired implementation at compile time by defining a preprocessor macro on the command line. The C-Sim v. 5.0 library provides additional modules usable for parallel algorithms testing. There is a Semaphore module that implements an integer semaphore and a Message Passing module that implements asynchronous message passing primitives. A qualified user can construct (as an additional program module) a set of proprietary operations that are close to a real communication interface (e.g. PVM orMPI). The model-time delay can be included inside the communication operations as well. 3. C-Sim utilization spectrum Various characteristics of a distributed and parallel program can be validated using the C-Sim library. A deadlockfree control flow and time independent result of computation are often tested. It is also possible to evaluate performance parameters. In this case, it is necessary to estimate a duration of computing operations and communications. There are examples at the website [1] that show possibilities of C-Sim utilization. Some of them are conventional models of queuing networks. The objective of these models is computation of a given queuing network performance parameters. The computation can be easily parallelized using e.g. PVM tool that has C language interface. Another group of examples are demonstration models of simple parallel algorithms. The most simple of them models several processes that utilize a shared resource using a binary semaphore (i.e. a model of multithreading). Locking and unlocking operations are replaced by operations provided by C-Sim’s Semaphore module. Time spent outside and inside the critical section is modeled by the csim hold() pseudo-statement. To demonstrate a flavor of C-Sim based programming, we can show a sketch of program code of a simple cyclic process that alters local computation with a shared resource access:

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

C-Sim ver. 5.0

C-Sim is a programming tool for simulation of discrete processes using a method of pseudoparallel processes. It is an extension of C language obtained by including SIMULA-like macros and functions. C-Sim uses a special C-functions and C-macros library. The typical application area of C-Sim is functional validation of distributed, parallel and fault-tolerant systems and programs.

متن کامل

Scanning impedance microscopy (SIM): A novel approach for AC transport imaging

Scanning Impedance Microscopy (SIM) is one of the novel scanning probe microscopy (SPM) techniques, which has been developed to taking image from sample surface, providing quantitative information with high lateral resolution on the interface capacitance, and investigating the local capacitance–voltage (C–V) behavior of the interface and AC transport properties. The SIM is an ordinary AFM equip...

متن کامل

Scanning impedance microscopy (SIM): A novel approach for AC transport imaging

Scanning Impedance Microscopy (SIM) is one of the novel scanning probe microscopy (SPM) techniques, which has been developed to taking image from sample surface, providing quantitative information with high lateral resolution on the interface capacitance, and investigating the local capacitance–voltage (C–V) behavior of the interface and AC transport properties. The SIM is an ordinary AFM equip...

متن کامل

Validated LC–MS/MS method for simultaneous determination of SIM and its acid form in human plasma and cell lysate: Pharmacokinetic application

Simvastatin (SIM) is a 3-hydroxy-3-methylglutaryl coenzyme A reductase inhibitor widely used in hyperlipidemia therapy. SIM has recently been studied for its anticancer activity at doses higher than those used for the hyperlipidemia therapy. This prompted us to study the pharmacokinetics of high-dose SIM in cancer patients. For this purpose, an LC-MS/MS method was developed to measure SIM and i...

متن کامل

Simulating Agent-Based Systems with HLA: The Case of SIM AGENT — Part II (03E–SIW–076)

In this paper we outline an approach to the distributed simulation of agent-based systems using the SIM AGENT toolkit and the High Level Architecture (HLA) simulator interoperability framework. Using a simple Tileworld scenario as an example, we show how the HLA can be used to flexibly distribute a SIM AGENT simulation with different agents being simulated on different machines. We outline the ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003